<%-- 
    Document   : p_compinfos
    Created on : 21 déc. 2011, 11:36:28
    Author     : MiniK
--%>

<%@page import="fr.annuaireComp.clientUtils.CompetenceModel"%>

<%@page contentType="text/html" pageEncoding="UTF-8"%>
<% CompetenceModel compInfo = (CompetenceModel) request.getAttribute("compinfosdata");%>

 <div id="compinfo">



<h2 id="ci_libelle"><%= compInfo.libelle%></h2>
<div>
    <p>  Id :<%= compInfo.id%></p>
    <p>  Nb Fille :<%= compInfo.competenceFilles.size()%></p>
    <p>Savoir: <span id="ci_savoir"> <%= compInfo.savoir.id%> <%= compInfo.savoir.libelle%></span> </p>
    <p>Domaine: <span id="ci_domaine"> <%= compInfo.domaine.id%> <%= compInfo.domaine.libelle%></span> </p>
    <%
        boolean canChangeSavoir = false;
       if (compInfo.competenceMereId == null || compInfo.competenceMereId.isEmpty()) {
           compInfo.competenceMereId = "**Aucune**";
           canChangeSavoir = true;
       }%>
    <p>Compétence Mère: <span id="ci_idmere"><%= compInfo.competenceMereId%></span></p>

    <form action="browse?action=delete" method="post">
        <input type="hidden" name="id" value="<%= compInfo.id%>" />
        <input type="submit" value="Supprimer" />
    </form>
</div>
<script type="text/javascript">
    var editUrl = "browse?action=edit&id=<%= compInfo.id%>";
    $("#ci_idmere").editInPlace({
        //callback: function(unused, enteredText) { return enteredText; },
        url: editUrl ,
        field_type: "select",
        select_options: competencesMeresEditInPlaceSelect
    });
        
    $("#ci_libelle").editInPlace({
        //callback: function(unused, enteredText) { return enteredText; },
        url: editUrl                 
    });
        
    <% if (canChangeSavoir) {%>
         $("#ci_savoir").editInPlace({
             //callback: function(unused, enteredText) { return enteredText; },
             url: editUrl,
             //params: editParams,
             value_required: "true",
             field_type: "select",
             setect_text: "Choisissez un savoir",
             select_options: savoirEditInpPlaceSelect
                
         });
         $("#ci_domaine").editInPlace({
             //callback: function(unused, enteredText) { return enteredText; },
             url: editUrl,
             //params: editParams,
             value_required: "true",
             field_type: "select",
             select_text: "Choisissez un domaine",
             select_options: domaineEditInpPlaceSelect
                
         });
    <% }%>
</script>
                    </div>